from selenium.webdriver.common.by import By
from base.base_page import BasePage

class SousuoPage(BasePage):
    def __init__(self):
        super().__init__()
        # 搜索框
        self.input_text = (By.XPATH,"//*[@id='app']/header/div/div[1]/div/div[2]/input")
        self.input_sousuo = (By.XPATH,"//*[@id='app']/header/div/div[1]/div/div[2]/span/span/i")
        # 第一本书
        self.book_fit = (By.XPATH,"//*[@id='app']/div[1]/div[1]/div[1]/div[2]/div[1]/a")

        # 定位搜索框
    def home_to_sousuo(self, keys):
        self.find_el(self.input_text).send_keys(keys)

        # 点击搜索框
    def home_to_dianjisousuo(self):
        self.find_el(self.input_sousuo).click()

        # 点击搜索第一本书
    def home_to_dianjibook(self):
        self.find_el(self.book_fit).click()
